#!/bin/sh
#
# $FreeBSD$
#

# PROVIDE: conffixperms
# REQUIRE: mountcritlocal
# BEFORE: sshd
# KEYWORD: nojail

. /etc/rc.subr

name="conffixperms"
start_cmd="conffixperms_start"
stop_cmd=":"

conffixperms_start()
{
	# Fix permissions on /etc files which may have been copied from
	# an MSDOS filesystem and which prevent the LiveCD from running sshd.
	cd /etc/ssh
	chmod 400 ssh_*_key >/dev/null 2>&1 || true
	chown root:wheel ssh_*_key >/dev/null 2>&1 || true
}

load_rc_config $name
run_rc_command "$1"
